package hdd.controller;

import POJO.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import service.TestService;

@Controller
public class TestController {
    @Autowired(required = false)
    private TestService testService;


    @RequestMapping("/testrmi")
    @ResponseBody
    public String test(){
        Test test = testService.gesTest();
        test.setName( "test_Name" );
        return test.getName();
    }

    @RequestMapping("/test")
    public String test1(ModelMap model){
        model.put( "test" ,"test freemarker 棒棒的");
        return "test";
    }
}
